package ar.com.solidussource.howmuchmobile.activities;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import ar.com.solidussource.howmuchmobile.R;
import ar.com.solidussource.howmuchmobile.activities.list.ProductpriceListActivity;
import ar.com.solidussource.howmuchmobile.common.entities.Market;

/**
 * Created with IntelliJ IDEA.
 * User: FT31270775
 * Date: 19/11/12
 * Time: 18:53
 * To change this template use File | Settings | File Templates.
 */
public class MarketDetailOnMapActivity extends Activity {
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        View v = (View) inflater.inflate(R.layout.map_market_click, null);

        final Market market = (Market) getIntent().getExtras().get("market");

        TextView name = (TextView)v.findViewById(R.id.name);
        name.setText("("+market.getMarketcategory().getName()+") "+market.getName());

        TextView address = (TextView)v.findViewById(R.id.address);
        address.setText(market.getAddress().getName());

        TextView score = (TextView)v.findViewById(R.id.score);
        score.setText("SCORE - "+Long.toString(market.getScore()));

        Button starButton = (Button) v.findViewById(R.id.starButton);

        starButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {



            }
        });

        Button pricesButton = (Button) v.findViewById(R.id.pricesButton);

        pricesButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

                Intent intent = new Intent(MarketDetailOnMapActivity.this, ProductpriceListActivity.class);
                intent.putExtra("market", market);
                startActivity(intent);

            }
        });

        setContentView(v);
    }
}